﻿<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="websocket.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function () {

           

        });
        var socket;
        function conn()
        {
             socket = new UDCsocket({
                 ip: '127.0.0.1', port: 11001, conn: function () { alert("连接成功"); }
               , recData: function (text) { alert('收到内容' + text); }
               , close: function () { alert("连接关闭"); }
                , error: function (msg) { alert("连接错误" + msg); }
             });
           
        }
        function SendData()
        {
            for (var i = 0; i < 15;i++)
            socket.SendData(0x01, "Send_content", { a: 'b' }, { b: 'c' })
        }
    </script>
</head>
<body>
    <button id='ToggleConnection' type="button" onclick='conn();'>
        连接服务器</button><br />
    <br />
    <button id='ToggleConnection' type="button" onclick='SendData();'>
        发送内容：beston</button><br />
    <br />
    <button id='ToggleConnection' type="button" onclick='seestate();'>
        查看状态</button><br />
    <br />
</body>
</html>
